-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the option for the external force orientation to be reperesented in the link frame #463
Add the option for the external force orientation to be reperesented in the link frame #463
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preliminary comments, I did not reviewed all of the PR.
Can you update the CHANGELOG.md file? Thanks!
Done in 6a7134d and a conflict in |
Thanks @HosameldinMohamed ! I will probably need a bit of help with the math, either @prashanthr05 or @Yeshasvitvs can help me on that? Thanks! |
this->m_reply.addString ( "Insert [single] or [multiple] to change the operation mode" ); | ||
this->m_reply.addString ( "The default frame orientation is the one of the base/root frame ([orient_global])" ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it one of the base/root frame or the world frame? The words base/root and global seem to not to go along well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're right it's confusing. However the phrase "The default frame orientation is the one of the base/root frame" was written before and I didn't want to change it even though the applied force's frame seems to have the orientation of the global one.
Check out this little demo where I apply forces in X,Y and Z directions in global_orient
mode:
@@ -147,7 +147,7 @@ void ExternalWrench::applyWrench() | |||
ignition::math::Vector3d newY = newZ.Cross (newX); | |||
ignition::math::Matrix4d rotation = ignition::math::Matrix4d (newX[0],newY[0],newZ[0],0,newX[1],newY[1],newZ[1],0,newX[2],newY[2],newZ[2],0, 0, 0, 0, 1); | |||
ignition::math::Quaterniond forceOrientation = rotation.Rotation(); | |||
ignition::math::Pose3d linkCoGPose (linkCoGPos - rotation*ignition::math::Vector3d ( 0,0,.15 ), forceOrientation); | |||
ignition::math::Pose3d W_p_F (linkCoGPos - rotation*ignition::math::Vector3d ( 0,0,.15 ), forceOrientation); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A pose can be identified with H
or T
. Here W_p_F
is confusing as to a position and not a Pose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And why the variable naming W_p_F
? Anyways the force are applied to the CoG of the link right? Only the visual is offset by these magic numbers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A pose can be identified with
H
orT
. HereW_p_F
is confusing as to a position and not a Pose.
Right, in the next commit I have changed the abbreviations to be more clear. Considering only Transformation T, Rotation R, or Position P.
And why the variable naming
W_p_F
? Anyways the force are applied to the CoG of the link right? Only the visual is offset by these magic numbers?
I have changed the name of the variable to more clear and explicit name.
|
||
math::Vector3d linkCoGPos = link->WorldCoGPose().Pos(); // Get link's COG position where wrench will be applied | ||
math::Vector3d newZ = force.Normalized(); // normalized force. I want the z axis of the cylinder's reference frame to coincide with my force vector | ||
math::Vector3d newX = newZ.Cross (math::Vector3d::UnitZ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we consider here the UnitZ of the Gazebo world ? or the UnitZ of the link?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the current setting is OK (in Gazebo world). Since UnitZ is used to construct the transformation from the applied force frame to the Link CoG frame (Lg_T_F
), which then is multiplied to the transformation between the world frame and the Link CoG frame:
ignition::math::Matrix4d W_T_F = W_T_Lg*Lg_T_F;
In this line for example.
|
Hi @HosameldinMohamed , what is the status of this PR? |
Hi @traversaro , it's pending me addressing to some of @prashanthr05 comments and a discussion we had. I'll do it very soon. |
@HosameldinMohamed @prashanthr05 if we do not have plans to continue on this PR in the short term, we can always close it and re-open it again once we want to work on it again. |
Hi @traversaro Right. I don't think I will be able to work on this PR in the short term. So I close it for now. |
Proposed feature to add:
To have an option to specify the wrenches orientations in the link frame.
The user interface can be similar to what had been done in Update external wrench plugin with mutiple wrenches and improve rpc responses #418
Where the user can write a command:
And the mode will change to "orient_local" where the applied forces will have the orientation of the link frame. Moreover, the user will specify the force components w.r.t the link frame.
Writing the command:
Will switch to the already implemented settings.
orient_global
.Related issue: #462
Other modification:
Before: If the user writes any 1-word command other than
single
, the mode is switched to multiple wrenches mode (see #418).After: If the user commands any 1-word command other than
single
,multiple
,orient_global
,orient_local
, they will receive an error and a message: